#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>
void reverse(char* l, char* r)
{
	while (l < r)
	{
		char tem = *l;
		*l = *r;
		*r = tem;
		l++;
		r--;
	};
}
int main()
{
	char arr[100] = { 0 };
	gets_s(arr);
	char* left = arr;
	char* right = arr + strlen(arr) - 1;
	reverse(left, right);
	char* start = arr;
	char* end = arr;
	while (*end != '\0')
	{
		while (*end != ' ' && *end != '\0')
		{
			end++;
		}
		reverse(start, end - 1);
		start = end + 1;
		if (*end != '\0')
			end++;
	}
	printf("%s", arr);
}